home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_HDF.idb / usr / freeware / include / hdf / cskphuff.h.z / cskphuff.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  3.6 KB  |  105 lines

  1. /****************************************************************************
  2.  * NCSA HDF                                                                 *
  3.  * Software Development Group                                               *
  4.  * National Center for Supercomputing Applications                          *
  5.  * University of Illinois at Urbana-Champaign                               *
  6.  * 605 E. Springfield, Champaign IL 61820                                   *
  7.  *                                                                          *
  8.  * For conditions of distribution and use, see the accompanying             *
  9.  * hdf/COPYING file.                                                        *
  10.  *                                                                          *
  11.  ****************************************************************************/
  12.  
  13.  /* $Id: cskphuff.h,v 1.6 1997/10/24 21:00:27 koziol Exp $ */
  14.  
  15.  /*-----------------------------------------------------------------------------
  16.  * File:    cskphuff.h
  17.  * Purpose: Header file for skipping huffman encoding information.
  18.  * Dependencies: should only be included from hcompi.h
  19.  * Invokes: none
  20.  * Contents: Structures & definitions for skipping huffman encoding.
  21.  * Structure definitions:
  22.  * Constant definitions:
  23.  *---------------------------------------------------------------------------*/
  24.  
  25. /* avoid re-inclusion */
  26. #ifndef __CSKPHUFF_H
  27. #define __CSKPHUFF_H
  28.  
  29. #if defined c_plusplus || defined __cplusplus
  30. extern      "C"
  31. {
  32. #endif                          /* c_plusplus || __cplusplus */
  33.  
  34. /*
  35.    ** from cskphuff.c
  36.  */
  37.  
  38.     extern int32 HCPcskphuff_stread
  39.                 (accrec_t * rec);
  40.  
  41.     extern int32 HCPcskphuff_stwrite
  42.                 (accrec_t * rec);
  43.  
  44.     extern int32 HCPcskphuff_seek
  45.                 (accrec_t * access_rec, int32 offset, int origin);
  46.  
  47.     extern int32 HCPcskphuff_inquire
  48.                 (accrec_t * access_rec, int32 *pfile_id, uint16 *ptag, uint16 *pref,
  49.                int32 *plength, int32 *poffset, int32 *pposn, int16 *paccess,
  50.                  int16 *pspecial);
  51.  
  52.     extern int32 HCPcskphuff_read
  53.                 (accrec_t * access_rec, int32 length, void * data);
  54.  
  55.     extern int32 HCPcskphuff_write
  56.                 (accrec_t * access_rec, int32 length, const void * data);
  57.  
  58.     extern intn HCPcskphuff_endaccess
  59.                 (accrec_t * access_rec);
  60.  
  61. #if defined c_plusplus || defined __cplusplus
  62. }
  63. #endif                          /* c_plusplus || __cplusplus */
  64.  
  65. /* The maximum source character code: */
  66. #define SKPHUFF_MAX_CHAR     255
  67.  
  68. /* One greater than the maximum source character code: */
  69. #define SUCCMAX     (SKPHUFF_MAX_CHAR+1)
  70.  
  71. /* Twice the maximum source character code: */
  72. #define TWICEMAX    (2*SUCCMAX+1)
  73.  
  74. /* The root node in the tree */
  75. #define ROOT        0
  76.  
  77. /* Skipping huffman [en|de]coding information */
  78. typedef struct
  79. {
  80.     intn        skip_size;      /* number of bytes in each element */
  81.     uintn     **left,           /* define the left and right pointer arrays */
  82.               **right;
  83.     uint8     **up;             /* define the up pointer array */
  84.     intn        skip_pos;       /* current byte to read or write */
  85.     int32       offset;         /* offset in the de-compressed array */
  86. }
  87. comp_coder_skphuff_info_t;
  88.  
  89. #ifndef CSKPHUFF_MASTER
  90. extern funclist_t cskphuff_funcs;   /* functions to perform skipping huffman encoding */
  91. #else
  92. funclist_t  cskphuff_funcs =
  93. {                               /* functions to perform skipping huffman encoding */
  94.     HCPcskphuff_stread,
  95.     HCPcskphuff_stwrite,
  96.     HCPcskphuff_seek,
  97.     HCPcskphuff_inquire,
  98.     HCPcskphuff_read,
  99.     HCPcskphuff_write,
  100.     HCPcskphuff_endaccess
  101. };
  102. #endif
  103.  
  104. #endif /* __CSKPHUFF_H */
  105.